<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/19
 * Time: 21:29
 */

namespace Admin\Model;

use Think\Model;

/**
 * Class LinksModel
 * @package Admin\Model
 * 友情链接管理
 */
class LinksModel  extends Model
{
    protected  $pk='lid';
    protected $tableName='links';
    /**
     * 友链添加编辑
     */
   public function store($data){
//       dd($data);die;
      $action=isset($data['lid'])? 'save' : 'add';
      $res=$this->$action($data);
       if($res){
           return ['valid'=>1,'msg'=>'操作成功'];
       }else{
           return ['valid'=>0,'msg'=>'操作失败'];
       }
   }
}